Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network drivers create directly TxToken / RxToken for smoltcp #810

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

stlankes
Copy link
Contributor

@stlankes stlankes commented Jul 28, 2023

For this purpose, it was necessary to avoid the creation of dynamic objects of the driver. This means that during compilation it must be defined which network interface is used. If the feature rtl8139 is activated, the driver for Realtek 8139 will be used. Otherwise the Virtio network interface will be used.

@stlankes stlankes enabled auto-merge July 28, 2023 20:35
@stlankes stlankes disabled auto-merge July 28, 2023 21:41
@stlankes stlankes marked this pull request as draft July 28, 2023 22:05
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jul 31, 2023
This feature is required for hermit-os/kernel#810. Without
this feature, the CI isn't able to test the RTL8139 interface.
stlankes added a commit to stlankes/hermit-rs that referenced this pull request Jul 31, 2023
This feature is required for hermit-os/kernel#810. Without
this feature, the CI isn't able to test the RTL8139 interface.
@stlankes stlankes changed the title using a exponential backoff to check the network device network drivers create directly TxToken / RxToken for smoltcp Aug 1, 2023
@stlankes stlankes requested a review from mkroening August 2, 2023 06:04
@stlankes stlankes marked this pull request as ready for review August 2, 2023 06:04
@mkroening mkroening added this pull request to the merge queue Aug 2, 2023
@mkroening mkroening removed this pull request from the merge queue due to a manual request Aug 2, 2023
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reduces read speed in our bandwidth test to 80 Mbit/s, according to @n-eiling.

@stlankes
Copy link
Contributor Author

stlankes commented Aug 2, 2023

Yes, the last commit was not useful. I removed it. It is already part of our stack. See https://github.com/hermitcore/libhermit-rs/blob/master/src/fd/socket/tcp.rs#L355-L360

@mkroening
Copy link
Member

mkroening commented Aug 2, 2023

Ah, makes sense. Still, without this PR, we can reach 191.4 MiB/s, and with it we can only reach 77.1 MiB/s.

Edit: Never mind, seems fine, the benchmark is just inconsistent.

For this purpose, it was necessary to avoid the creation of dynamic objects of the driver. This means that during compilation it must be defined which network interface is used. If the feature `rtl8139` is activated, the driver for Realtek 8139 will be used. Otherwise the Virtio network interface will be used.

using a exponential backoff to check the network device

if exponential backoff has completed, the task will be blocked
and waits for an network interrupt

poll device before the device checks the future

remove obsolete code

network drivers create directly TxToken / RxToken for smoltcp

For this purpose, it was necessary to avoid the creation of dynamic
objects of the driver. This means that during compilation it must
be defined which network interface is used. If the feature `rtl8139`
is activated, the driver for Realtek 8139 will be used. Otherwise the
Virtio network interface will be used.

build Virtio network driver only if the feature `tcp` is set

feature `tcp` must be activated to support any network interface

remove compiler warnings

remove compiler warnings

remove compiler warnings

use polling mode for read / write operations on a socket

idle task enables network interrupt, while the read function disable
it

enable network interrupts, if a socket is blocking

add missing import

check device driver only, if the device is available

remove compiler warnings

add mmio support

add dummy network interface for aarch64

add missing file for mmio support

add check if the feature tcp is available

revert block_on to the original version

revise CI workflow to support the feature rtl8139
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could confirm that we can sometimes get good performance with this.

@mkroening mkroening added this pull request to the merge queue Aug 2, 2023
Merged via the queue into hermit-os:master with commit 0f4e8e3 Aug 2, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants